package com.lxy.cxcyxmmsbackend.sys.mapper;

import com.lxy.cxcyxmmsbackend.sys.entity.QxglCd;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 刘新颖
 * @since 2024-01-07
 */
public interface QxglCdMapper extends BaseMapper<QxglCd> {
    /**
     * 查询菜单
     *
     * @param
     * @return List<QxglCd>
     * @author lxy
     * @date 2024/1/7
     **/
    List<QxglCd> selectQxglCds();

    /**
     * 查询所有菜单id
     *
     * @param
     * @return List<QxglCd>
     * @author lxy
     * @date 2024/1/7
     **/
    List<String> selectAllMid();

    /**
     * 模糊查询
     *
     * @param cdMc
     * @return List<QxglCd>
     * @author lxy
     * @date 2024/1/7
     **/
    List<QxglCd> selectQxglCdByCdMc(@Param("cdMc") String cdMc);

    /**
     * 新增菜单
     *
     * @param qxglCd
     * @return int
     * @author lxy
     * @date 2024/1/7
     **/
    int insertQxglCd(QxglCd qxglCd);

    /**
     * 修改菜单
     *
     * @param qxglCd
     * @return int
     * @author lxy
     * @date 2024/1/7
     **/
    int updateQxglCd(QxglCd qxglCd);

    /**
     * 删除菜单
     *
     * @param cdBh
     * @return int
     * @author lxy
     * @date 2024/1/7
     **/
    int deleteQxglCd(@Param("cdBh") String cdBh);

    /**
     * 删除角色菜单关系表中相关记录
     *
     * @param cdBh
     * @return int
     * @author lxy
     * @date 2024/1/7
     **/
    int deleteRoleMenuRel(@Param("cdBh") String cdBh);

    /**
     * 根据角色查询菜单
     *
     * @param roleBh
     * @return List<QxglCd>
     * @author lxy
     * @date 2024/1/7
     **/
    List<QxglCd> selectMenusByRole(@Param("roleBh") String roleBh);
}
